//125 - 验证回文串
class Solution {
    public boolean isPalindrome(String s) {
        StringBuffer s1 = new StringBuffer();
        s = s.toLowerCase();
        for(int i = 0; i < s.length(); i++){
            if(isLower(s.charAt(i))){
                s1.append(s.charAt(i));
            }
        }
        int left = 0;
        int right = s1.length() - 1;
        while(left < right){
            if(s1.charAt(left) != s1.charAt(right)){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
    public boolean isLower(char s){
        if(s >= 'a' && s <= 'z' || s >= '0' && s <= '9'){
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        boolean a = solution.isPalindrome("0P");
        System.out.println(a);
    }
}
public class Test {
}
